package com.eastmoney.emis.edda.infrastructure.edda.mapper;

import com.eastmoney.emis.datasource.annotation.TargetDataSource;
import com.eastmoney.emis.edda.common.DbName;
import com.eastmoney.emis.edda.domain.entity.EddaBind;
import com.eastmoney.emis.edda.infrastructure.edda.po.EmhkEddaBindPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.infrastructure.edda.mapper
 * @author: 汪程程
 * @date: 2022/10/8 9:56 AM
 * @version: 1.0
 */
@Mapper
public interface EmhkEddaBindMapper {

    @TargetDataSource(DbName.ACCOUNT)
    void addEddaBind(@Param("clientId")String clientId, @Param("eddaBindPo") EmhkEddaBindPo eddaBindPo);

    @TargetDataSource(DbName.ACCOUNT)
    List<EmhkEddaBindPo> findAllByClientId(@Param("clientId") String clientId);
    @TargetDataSource(DbName.ACCOUNT)
    EmhkEddaBindPo findByClientIdAndMandateId(@Param("clientId") String clientId, @Param("mandateId") String mandateId);
    @TargetDataSource(DbName.ACCOUNT)
    EmhkEddaBindPo findByClientIdAndBankAccount(@Param("clientId") String clientId, @Param("bankCode")String bankCode, @Param("bankAccount") String bankAccount);

    @TargetDataSource(DbName.ACCOUNT)
    void update(@Param("clientId")String clientId, @Param("eddaBindPo") EmhkEddaBindPo eddaBindPo);
}
